/*
 * Created on 2005-2-16
 */
package org.nanhill.commons.lang;

import java.net.URL;

import javax.swing.Icon;
import javax.swing.ImageIcon;

/**
 * @author wang lin
 *
 */
public class SimpleResourceLoader {
	
	public static Icon getIconResource(Class clazz, String name) {
		URL url= clazz.getResource(name);
		if (url == null) {
			System.err.println("Warning: could not load \""+name+"\" icon");
			return null;
		}
		return new ImageIcon(url);
	}

}
